package logic;

import java.io.Serializable;

/** 
 * Block de tipo variable
 */

public class Var  implements Serializable, Block{
	
	/**
     * ATTRIBUTES
     */
	// Id del serialize
	private static final long serialVersionUID = 225547088241229978L;
	// Valor de la variable
	private int     _Valor;
	// si es constante
	private boolean _Constant;
	// Identificador
	private int _Id;
	
	/**
	 * Constructor
	 */
	public Var(){
		_Valor    = 0;
		_Constant = false;
	}

	/**
	 * Gets
	 */
	public int get_Valor() {
		return _Valor;
	}

	public boolean is_Constant() {
		return _Constant;
	}
	
	public int getId() {
		return _Id;
	}
	
	/**
	 * Sets
	 */
	public void set_Valor(int _Valor) {
		this._Valor = _Valor;
	}
	
	public void set_Constant(boolean _Constant) {
		this._Constant = _Constant;
	}
	
	public void set_Id(int pId) {
		this._Id = pId;
	}

	/*
	 * (non-Javadoc)
	 * @see logic.Block#getType()
	 */
	@Override
	public int getType() {
		return Constantes.TYPE_VAR;
	}

	@Override
	public String toString() {
		return "Var [_Valor=" + _Valor + ", _Constant=" + _Constant + "]";
	}

}
